﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Caliburn.PresentationFramework.Filters;
using Caliburn.PresentationFramework.RoutedMessaging;
using Caliburn.PresentationFramework.Screens;
using Results = Caliburn.ShellFramework.Results;
using System.Windows;
using Caliburn.Core.InversionOfControl;

namespace MTGenome.ViewModels
{
    [Rescue("Rescue")]
    public abstract class ScreenBase : Screen
    {
        public ScreenBase(MainWindowViewModel mainWindow)
        {
            MainWindow = mainWindow;
        }

        public MainWindowViewModel MainWindow
        {
            get;
            private set;
        }

        public virtual bool CanShow
        {
            get { return true; }
        }

        public void Activate()
        {
            MainWindow.ActivateItem(this);
        }

        public void Rescue(Exception exc)
        {
            IoC.Get<IRescueApp>().Rescue(exc);
        }
    }
}
